const userList = [
  {
    id: 1,
    username: 'admin',
    nickname: '管理员',
    email: 'admin@template.com',
    phone: '123456789',
  },
  {
    id: 2,
    username: 'editor',
    nickname: '编辑',
    email: 'editor@template.com',
    phone: '234567890',
  },
]

export default [
  // user list
  {
    url: '/mock/user/list',
    type: 'get',
    response: (config) => {
      const { authorization } = config.headers
      // mock error
      if (!authorization) {
        return {
          code: 401,
          message: '请先登录',
        }
      }
      return {
        code: 200,
        data: {
          list: userList,
          total: userList.length,
        },
      }
    },
    timeout: 500,
  },
]
